11088 - End up with more teams (DP), 11282 - Mixing invitations & 1481 - Arrange...
[and.git] / Mi manual de algoritmos / version_maraton_nacional_2008 / src / combinatoria / pascal_triangle.tex
blobd1b0cfcce85aa475a2b9e65dfdd1afc7a7e632d3
1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 {\ttfamily \raggedright {
4 \noindent
5 \mbox{}\textbf{\textcolor{Blue}{const}}\ \textcolor{ForestGreen}{int}\ N\ \textcolor{BrickRed}{=}\ \textcolor{Purple}{30}\textcolor{BrickRed}{;} \\
6 \mbox{}\textcolor{ForestGreen}{long}\ \textcolor{ForestGreen}{long}\ choose\textcolor{BrickRed}{[}N\textcolor{BrickRed}{+}\textcolor{Purple}{1}\textcolor{BrickRed}{][}N\textcolor{BrickRed}{+}\textcolor{Purple}{1}\textcolor{BrickRed}{];} \\
7 \mbox{}\ \ \textit{\textcolor{Brown}{/*\ Binomial\ coefficients\ */}} \\
8 \mbox{}\ \ \textbf{\textcolor{Blue}{for}}\ \textcolor{BrickRed}{(}\textcolor{ForestGreen}{int}\ i\textcolor{BrickRed}{=}\textcolor{Purple}{0}\textcolor{BrickRed}{;}\ i\textcolor{BrickRed}{$<$=}N\textcolor{BrickRed}{;}\ \textcolor{BrickRed}{++}i\textcolor{BrickRed}{)}\ choose\textcolor{BrickRed}{[}i\textcolor{BrickRed}{][}\textcolor{Purple}{0}\textcolor{BrickRed}{]}\ \textcolor{BrickRed}{=}\ choose\textcolor{BrickRed}{[}i\textcolor{BrickRed}{][}i\textcolor{BrickRed}{]}\ \textcolor{BrickRed}{=}\ \textcolor{Purple}{1}\textcolor{BrickRed}{;} \\
9 \mbox{}\ \ \textbf{\textcolor{Blue}{for}}\ \textcolor{BrickRed}{(}\textcolor{ForestGreen}{int}\ i\textcolor{BrickRed}{=}\textcolor{Purple}{1}\textcolor{BrickRed}{;}\ i\textcolor{BrickRed}{$<$=}N\textcolor{BrickRed}{;}\ \textcolor{BrickRed}{++}i\textcolor{BrickRed}{)} \\
10 \mbox{}\ \ \ \ \textbf{\textcolor{Blue}{for}}\ \textcolor{BrickRed}{(}\textcolor{ForestGreen}{int}\ j\textcolor{BrickRed}{=}\textcolor{Purple}{1}\textcolor{BrickRed}{;}\ j\textcolor{BrickRed}{$<$}i\textcolor{BrickRed}{;}\ \textcolor{BrickRed}{++}j\textcolor{BrickRed}{)} \\
11 \mbox{}\ \ \ \ \ \ choose\textcolor{BrickRed}{[}i\textcolor{BrickRed}{][}j\textcolor{BrickRed}{]}\ \textcolor{BrickRed}{=}\ choose\textcolor{BrickRed}{[}i\textcolor{BrickRed}{-}\textcolor{Purple}{1}\textcolor{BrickRed}{][}j\textcolor{BrickRed}{-}\textcolor{Purple}{1}\textcolor{BrickRed}{]}\ \textcolor{BrickRed}{+}\ choose\textcolor{BrickRed}{[}i\textcolor{BrickRed}{-}\textcolor{Purple}{1}\textcolor{BrickRed}{][}j\textcolor{BrickRed}{];} \\
13 } \normalfont\normalsize